﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Windows.Forms;
using Dataweb.NShape.WinFormsUI;
using Dataweb.NShape;
using Dataweb.NShape.Advanced;
using Dataweb.NShape.GestaultShapes;

namespace LittleBoxesNShape
{
    public partial class Form1 : Form
    {
        Diagram dgram;
        public Form1()
        {
            InitializeComponent();
            dgram = new Diagram("d1");
            display1.Diagram = dgram;

            project1.Create();
            project1.AddLibrary(Assembly.GetAssembly(typeof(GComponent)));

            // This illustrates how to programmatically build composite shapes
            GComponent threeToTwo = (GComponent)project1.ShapeTypes["GComponent"].CreateInstance();
            GPort in1 = (GPort)project1.ShapeTypes["GPort"].CreateInstance();
            GPort in2 = (GPort)project1.ShapeTypes["GPort"].CreateInstance();
            GPort in3 = (GPort)project1.ShapeTypes["GPort"].CreateInstance();
            GPort out1 = (GPort)project1.ShapeTypes["GPort"].CreateInstance();
            GPort out2 = (GPort)project1.ShapeTypes["GPort"].CreateInstance();
            threeToTwo.Children.Add(in1);
            threeToTwo.Children.Add(in2);
            threeToTwo.Children.Add(in3);
            threeToTwo.Children.Add(out1);
            threeToTwo.Children.Add(out2);
            Template ttt = new Template("3 to 2", threeToTwo);
            toolSetController1.AddTool(new PlanarShapeCreationTool(ttt));
        }
    }
}
